package com.cg.service.impl;

import com.cg.dto.AddWorkTypeDTO;
import com.cg.entity.WorkType;
import com.cg.mapper.WorkTypeMapper;
import com.cg.result.R;
import com.cg.service.IWorkTypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 加
 * @since 2025-02-15
 */
@Service
public class WorkTypeServiceImpl extends ServiceImpl<WorkTypeMapper, WorkType> implements IWorkTypeService {

    @Override
    public R addWorkType(AddWorkTypeDTO addWorkTypeDTO) {
        WorkType workType=new WorkType();
        BeanUtils.copyProperties(addWorkTypeDTO,workType);
        save(workType);
        return R.Success("新增类型成功");
    }
}
